|
![](/i/fill.gif) |
In article <3db7ed1f@news.povray.org> , "Wu Yang" <wya### [at] cs wright edu>
wrote:
> Thank you for your reply. What I mean is that: when I see the value of
> Mesh->Data->Vertices, I can get three values. These three values is the x
> values of a triangle's three corners, not (x,y,z) of a corner.
No, a vertex is a "corner". And "vertices" is the plural of "vertex".
> I want get
> the (x,y,z) of every corner. Could you please give me some advice? Thanks
You need to know the index of the three triangle vertices, as the whole
mesh.cpp code does all over the place:
MESH *Mesh = ...;
MESH_TRIANGLE *Triangle = &(Mesh->Triangles[index]);
Mesh->Data->Vertices[Triangle->P1][X]
Mesh->Data->Vertices[Triangle->P1][Y]
Mesh->Data->Vertices[Triangle->P1][Z]
Mesh->Data->Vertices[Triangle->P2][X]
Mesh->Data->Vertices[Triangle->P2][Y]
Mesh->Data->Vertices[Triangle->P2][Z]
Mesh->Data->Vertices[Triangle->P3][X]
Mesh->Data->Vertices[Triangle->P3][Y]
Mesh->Data->Vertices[Triangle->P3][Z]
Really, I don't want to be discouraging, but if you have such problems, it
will be a very frustrating experience to look at the POV-Ray source code.
And you won't be learning much from it...
Thorsten
Post a reply to this message
|
![](/i/fill.gif) |